3.44 \(\int \frac {1}{a+b \csc (c+d x)} \, dx\)

Optimal. Leaf size=57 \[ \frac {2 b \tanh ^{-1}\left (\frac {a+b \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a d \sqrt {a^2-b^2}}+\frac {x}{a} \]

[Out]

x/a+2*b*arctanh((a+b*tan(1/2*d*x+1/2*c))/(a^2-b^2)^(1/2))/a/d/(a^2-b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3783, 2660, 618, 206} \[ \frac {2 b \tanh ^{-1}\left (\frac {a+b \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a d \sqrt {a^2-b^2}}+\frac {x}{a} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Csc[c + d*x])^(-1),x]

[Out]

x/a + (2*b*ArcTanh[(a + b*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]])/(a*Sqrt[a^2 - b^2]*d)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 2660

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[(2*e)/d, Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 3783

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(-1), x_Symbol] :> Simp[x/a, x] - Dist[1/a, Int[1/(1 + (a*Sin[c + d
*x])/b), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {1}{a+b \csc (c+d x)} \, dx &=\frac {x}{a}-\frac {\int \frac {1}{1+\frac {a \sin (c+d x)}{b}} \, dx}{a}\\ &=\frac {x}{a}-\frac {2 \operatorname {Subst}\left (\int \frac {1}{1+\frac {2 a x}{b}+x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a d}\\ &=\frac {x}{a}+\frac {4 \operatorname {Subst}\left (\int \frac {1}{-4 \left (1-\frac {a^2}{b^2}\right )-x^2} \, dx,x,\frac {2 a}{b}+2 \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a d}\\ &=\frac {x}{a}+\frac {2 b \tanh ^{-1}\left (\frac {b \left (\frac {a}{b}+\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.11, size = 59, normalized size = 1.04 \[ \frac {-\frac {2 b \tan ^{-1}\left (\frac {a+b \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b^2-a^2}}\right )}{d \sqrt {b^2-a^2}}+\frac {c}{d}+x}{a} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Csc[c + d*x])^(-1),x]

[Out]

(c/d + x - (2*b*ArcTan[(a + b*Tan[(c + d*x)/2])/Sqrt[-a^2 + b^2]])/(Sqrt[-a^2 + b^2]*d))/a

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 238, normalized size = 4.18 \[ \left [\frac {2 \, {\left (a^{2} - b^{2}\right )} d x + \sqrt {a^{2} - b^{2}} b \log \left (\frac {{\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, a b \sin \left (d x + c\right ) + a^{2} + b^{2} + 2 \, {\left (b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}}}{a^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right )}{2 \, {\left (a^{3} - a b^{2}\right )} d}, \frac {{\left (a^{2} - b^{2}\right )} d x + \sqrt {-a^{2} + b^{2}} b \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \sin \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )}\right )}{{\left (a^{3} - a b^{2}\right )} d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*csc(d*x+c)),x, algorithm="fricas")

[Out]

[1/2*(2*(a^2 - b^2)*d*x + sqrt(a^2 - b^2)*b*log(((a^2 - 2*b^2)*cos(d*x + c)^2 + 2*a*b*sin(d*x + c) + a^2 + b^2
 + 2*(b*cos(d*x + c)*sin(d*x + c) + a*cos(d*x + c))*sqrt(a^2 - b^2))/(a^2*cos(d*x + c)^2 - 2*a*b*sin(d*x + c)
- a^2 - b^2)))/((a^3 - a*b^2)*d), ((a^2 - b^2)*d*x + sqrt(-a^2 + b^2)*b*arctan(-sqrt(-a^2 + b^2)*(b*sin(d*x +
c) + a)/((a^2 - b^2)*cos(d*x + c))))/((a^3 - a*b^2)*d)]

________________________________________________________________________________________

giac [A]  time = 0.32, size = 77, normalized size = 1.35 \[ -\frac {\frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (b) + \arctan \left (\frac {b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a}{\sqrt {-a^{2} + b^{2}}}\right )\right )} b}{\sqrt {-a^{2} + b^{2}} a} - \frac {d x + c}{a}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*csc(d*x+c)),x, algorithm="giac")

[Out]

-(2*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(b) + arctan((b*tan(1/2*d*x + 1/2*c) + a)/sqrt(-a^2 + b^2)))*b/(sqrt(
-a^2 + b^2)*a) - (d*x + c)/a)/d

________________________________________________________________________________________

maple [A]  time = 0.57, size = 70, normalized size = 1.23 \[ -\frac {2 b \arctan \left (\frac {2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{d a \sqrt {-a^{2}+b^{2}}}+\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+b*csc(d*x+c)),x)

[Out]

-2/d/a*b/(-a^2+b^2)^(1/2)*arctan(1/2*(2*b*tan(1/2*d*x+1/2*c)+2*a)/(-a^2+b^2)^(1/2))+2/d/a*arctan(tan(1/2*d*x+1
/2*c))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*csc(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more details)Is 4*a^2-4*b^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 0.45, size = 184, normalized size = 3.23 \[ \frac {x}{a}-\frac {2\,b\,\mathrm {atanh}\left (\frac {2\,a^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-2\,b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+a\,b^3\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+3\,a^2\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{a\,\left (2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\right )\,\sqrt {a^2-b^2}}\right )}{a\,d\,\sqrt {a^2-b^2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a + b/sin(c + d*x)),x)

[Out]

x/a - (2*b*atanh((2*a^2*sin(c/2 + (d*x)/2)*(a^2 - b^2) - 2*b^4*sin(c/2 + (d*x)/2) - 2*b^2*sin(c/2 + (d*x)/2)*(
a^2 - b^2) + a*b^3*cos(c/2 + (d*x)/2) + 3*a^2*b^2*sin(c/2 + (d*x)/2) + a*b*cos(c/2 + (d*x)/2)*(a^2 - b^2))/(a*
(2*a^2*sin(c/2 + (d*x)/2) + a*b*cos(c/2 + (d*x)/2))*(a^2 - b^2)^(1/2))))/(a*d*(a^2 - b^2)^(1/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{a + b \csc {\left (c + d x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*csc(d*x+c)),x)

[Out]

Integral(1/(a + b*csc(c + d*x)), x)

________________________________________________________________________________________